package cn.iocoder.yudao.module.contract.controller.admin.invoiceContract.vo;

import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
import cn.iocoder.yudao.module.contract.utils.StringUtils;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;

@Schema(description = "管理后台 - 发票 Response VO")
@Data
@ExcelIgnoreUnannotated
public class InvoiceContractExportVO {

    @Schema(description = "状态")
    @ExcelProperty(value = "状态", converter = DictConvert.class)
    @DictFormat("invoice_contract_status") // TODO 代码优化：建议设置到对应的 DictTypeConstants 枚举类中
    private String status;

    @Schema(description = "生成方式")
    @ExcelProperty(value = "生成方式", converter = DictConvert.class)
    @DictFormat("invoice_contract_generation_type") // TODO 代码优化：建议设置到对应的 DictTypeConstants 枚举类中
    private String generationType;

    @Schema(description = "公司编码")
    @ExcelProperty("公司编码")
    private String companyid;

    @Schema(description = "合同号")
    @ExcelProperty("合同号")
    private String contractNo;

    @Schema(description = "客户编码")
    @ExcelProperty("客户编码")
    private String clientCode;

    @Schema(description = "购方名称")
    @ExcelProperty("购方名称")
    private String gfmc;

    @Schema(description = "合同生成日期", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("合同生成日期")
    private LocalDateTime generatedTime;

    @Schema(description = "签订日期")
    @ExcelProperty("签订日期")
    private String signingDate;

    @Schema(description = "开票月")
    @ExcelProperty("开票月")
    private String invoiceMonth;

    @Schema(description = "合同总金额")
    @ExcelProperty("合同总金额")
    private String totalMoney;

    @Schema(description = "组织名称")
    @ExcelProperty("组织名称")
    private String sellertaxname;

    @Schema(description = "合同类型")
    @ExcelProperty(value = "合同类型", converter = DictConvert.class)
    @DictFormat("invoice_contract_type") // TODO 代码优化：建议设置到对应的 DictTypeConstants 枚举类中
    private String contractType;

    @Schema(description = "运输方式解释")
    @ExcelProperty("运输方式解释")
    private String vsbedms;

    @Schema(description = "原件签收状态")
    @ExcelProperty("原件签收状态")
    private String fileIds;

    @Schema(description = "扫描件签收状态")
    @ExcelProperty("扫描件签收状态")
    private String scanFileIds;

    @Schema(description = "区域名称")
    @ExcelProperty("区域名称")
    private String salesmethodname;

    @Schema(description = "雇员名称")
    @ExcelProperty("雇员名称")
    private String qyusername;

    @Schema(description = "异常原因")
    @ExcelProperty("异常原因")
    private String abnormalCause;


    public String getFileIds() {
        if(StringUtils.isBlank(fileIds)){
            return "未签收";
        }else{
            return "已签收";
        }
    }
    public String getScanFileIds() {
        if(StringUtils.isBlank(scanFileIds)){
            return "未签收";
        }else{
            return "已签收";
        }
    }
}
